180 PART 4 Comparing Groups

2.

Calculate Q with the following formula: Q

e1.96 SE where Q is simply a

convenient intermediate quantity that will be used in the next part of

the calculation, and e is the mathematical constant 2.718.

3.

Find the lower and upper limits of the CI with the following formula:

95% CI

(

)

RR Q to RR

Q

For confidence levels other than 95 percent, replace the z-score of 1.96 in Step 2

with the corresponding z-score shown in Table 10-1 of Chapter 10. As an example,

for 90 percent confidence levels, use 1.64, and for 99 percent confidence levels,

use 2.58.

For the example in Figure 13-2, you calculate 95 percent CI around the observed

risk ratio as follows:

1.

SE

7 / (14

21)

27 / (12

39), which is 0.2855.

2.

Q

e1.96 0.2855, which is 1.75.

3.

The 95% CI

2.17 1.75 to (2.17

1.75), which is 1.24 to 3.80.

Using this formula, the risk ratio would be expressed as 2.17, 95 percent CI 1.24

to 3.80.

You could also use R to calculate a risk ratio and 95 percent CI for the fourfold

table in Figure 13-2 with the following steps:

1.

Create a matrix.

Create a matrix called obese_HTN with this code: obese_HTN <-

matrix(c(14,12,7,27),nrow = 2, ncol = 2).

2.

Load a library.

For many epidemiologic calculations, you can use the epitools package in R and

use a command from this package to calculate the risk ratio and 95 percent

CI. Load the epitools library with this command: library(epitools).

3.

Run the command on the matrix.

In this case, run the riskratio.wald command on the obese_HTN matrix you

created in Step 1: riskratio.wald(obese_HTN).

The output is shown in Listing 13-1.